package com.fxkj.cloud.drms.infra.converter;

import com.fxkj.cloud.drms.domain.alarm.AlarmHistoryDomain;
import com.fxkj.cloud.drms.domain.alarm.AlarmStatistics;
import com.fxkj.cloud.drms.domain.commandSettingHistory.CommandSettingHistoryDomain;
import com.fxkj.cloud.drms.infra.persistence.po.AlarmHistoryPO;
import com.fxkj.cloud.drms.infra.persistence.po.AlarmStatisticsInfo;
import com.fxkj.cloud.drms.infra.persistence.po.CommandSettingHistoryPO;
import com.fxkj.common.converter.AbstractPOConverter;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * <p>description: </p>
 *
 * @author ww
 * @date 2025-03-25 11:06:40
 */
@Mapper(componentModel = "spring")
public interface AlarmHistoryConverter {

    AlarmHistoryDomain toDomain(AlarmHistoryPO alarmHistoryPO);

    List<AlarmHistoryDomain> toDomain(List<AlarmHistoryPO> alarmHistoryPOList);

    @Mapping(target = "alarmName", source = "alarmName")
    AlarmHistoryPO toPO(AlarmHistoryDomain alarmHistoryDomain);

    List<AlarmHistoryPO> toPO(List<AlarmHistoryDomain> alarmHistoryDomains);

    @Mapping(target = "alarmCount", source = "alarm_count")
    @Mapping(target = "alarmLevel", source = "alarm_level")
    AlarmStatistics toStatistics(AlarmStatisticsInfo alarmStatisticsInfo);

    List<AlarmStatistics> toStatistics(List<AlarmStatisticsInfo> alarmStatisticsInfoList);
}
